<template>
	<view class="content flex">
		<view class="flex inputBorder">
			<view class="minWidth">姓名</view>
			<view>
				  <u--input
				    placeholder="请输入姓名"
				   border="none"
				    v-model="username"
		
				  ></u--input>
			</view>
		</view>
		<view class="flex inputBorder">
			<view class="minWidth">手机号</view>
			<view>
				  <u--input
				    placeholder="请输入手机号"
			
				    v-model="mobile"
		border="none"
				  ></u--input>
			</view>
		</view>
		<view class="flex inputBorder">
			<view class="minWidth">身份证</view>
			<view>
				  <u--input
				    placeholder="请输入身份证"
				border="none"
				    v-model="card_no"
		
				  ></u--input>
			</view>
		</view>
		<view class="add" @click="add">
			添加出行人
		</view>
	</view>
</template>

<script>
	import http from '@/apis/http.js'
	export default {
		data() {
			return {
				username:'',
				mobile:'',
				card_no:'',
			}
		},
		methods: {
			add(){
				http.POST('user_vip/addExchange',{username:this.username,mobile:this.mobile,card_no:this.card_no}).then(res=>{
					if(res.code == 1){
						uni.reLaunch({
							url:'/pages/exchange/exchange'
						})
					}else{
						uni.showToast({
							'title':res.msg,
							'icon':'none'
						})
					}
				})
			}
		}
	}
</script>

<style>
	.flex{display: flex;}
	.content {flex-direction: column; padding: 20rpx 30rpx;}
	.inputBorder { border-bottom: 1px solid #c7c7c7; margin-top: 40rpx;}
	.minWidth { width: 150rpx;}
	.add { text-align: center;  margin: 80rpx 0 0 40rpx; color:#fff; height: 70rpx; line-height: 70rpx; width: 90%;  border-radius: 50rpx; background-color: #67b6a1;}
	
</style>
